<template>
  <el-dialog title="详细信息" :visible.sync="dialogVisible" class="dialog">
    <el-descriptions direction="vertical" :column="2" border>
      
      <el-descriptions-item label="交易金额">{{
        info.amount
      }}</el-descriptions-item>
      <el-descriptions-item label="操作时间">{{ info.approvalTime }}</el-descriptions-item>
      <el-descriptions-item label="服务费">{{ info.serviceFee }}</el-descriptions-item>
      <el-descriptions-item label="操作前余额">{{ info.beforeBalance }}</el-descriptions-item>
      <el-descriptions-item label="交易hash">{{ info.hash }}</el-descriptions-item>
      <el-descriptions-item label="交易内容">{{ info.content }}</el-descriptions-item>
      <el-descriptions-item label="操作后余额">{{ info.thenBalance }}</el-descriptions-item>
      <el-descriptions-item label="收款地址">{{ info.toAddress }}</el-descriptions-item>
      <el-descriptions-item label="交易类型">{{ setTypeTxt(info.type) }}</el-descriptions-item>
      <el-descriptions-item label="交易状态">{{ setStateTxt(info.state) }}</el-descriptions-item>
      <el-descriptions-item label="操作人">{{ info.createTime }}</el-descriptions-item>
      
      
    </el-descriptions>

    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
import { _isMobile } from '@/utils/index'
export default {
  data () {
    return {
      dialogVisible: false,
      info: {},
      isMobile: _isMobile
    }
  },

  methods: {
    show (e) {
      this.dialogVisible = true
      this.info = e
    },
    setStateTxt(index) {
      let str = ''
      switch (Number(index)) {
        case 1:
          str = '审核中'
          break
        case 2:
          str = '已完成'
          break
        case 3:
          str = '失败'
          break
      }
      return str
    },
    setTypeTxt(index) {
      let str = ''
      switch (Number(index)) {
        case 1:
          str = '充值'
          break
        case 2:
          str = '提现'
          break
        case 3:
          str = '投注'
          break
      }
      return str
    },
  }
}
</script>
